package com.qingpeng.pay.activity;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.qingpeng.pay.R;
import com.qingpeng.pay.base.BaseActivity;
import com.qingpeng.pay.base.BaseFragment;
import com.qingpeng.pay.views.TitleBar;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

public class TextActivity extends BaseActivity {
    @BindView(R.id.title)
    TitleBar title;
    @BindView(R.id.text_message)
    TextView textMessage;
    @BindView(R.id.ll_message)
    LinearLayout llMessage;
    @BindView(R.id.text_invite)
    TextView textInvite;
    @BindView(R.id.ll_invite)
    LinearLayout llInvite;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_notice;
    }

    @Override
    protected int getRootViewId() {
        return 0;
    }

    @Override
    protected int getRefreshId() {
        return 0;
    }

    @Override
    protected int getListViewId() {
        return 0;
    }

    @Override
    public void onResume() {
        super.onResume();
        title.getLlLeft().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        String type = getIntent().getStringExtra("type");
        String string = getIntent().getStringExtra("string");
        title.setTitle(type);
        if (type.equals("邀请")){
            llMessage.setVisibility(View.GONE);
            llInvite.setVisibility(View.VISIBLE);
            textInvite.setText("邀请码"+string);
        }else if (type.equals("通知")){
            llMessage.setVisibility(View.VISIBLE);
            llInvite.setVisibility(View.GONE);
            textMessage.setText(string);
        }else if (type.equals("公告")){
            llMessage.setVisibility(View.VISIBLE);
            llInvite.setVisibility(View.GONE);
            textMessage.setText(string);
        }
    }
}
